package com.tbit.main.service.impl;

import com.tbit.main.dao.core.HelmetBoundDao;
import com.tbit.main.pojo.Helmet;
import com.tbit.main.pojo.HelmetBound;
import com.tbit.main.service.HelmetBoundService;
import com.tbit.main.util.DateTimeUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author LMY
 * @create 2022-10-12 10:44
 */
@Service
public class HelmetBoundServiceImpl implements HelmetBoundService {

    @Autowired
    private HelmetBoundDao helmetBoundDao;

    @Override
    public void insert(HelmetBound helmetBound) {
        helmetBound.setAddTime(DateTimeUtil.getNowTime());
        helmetBoundDao.insert(helmetBound);
    }

    @Override
    public Helmet getMac(String helmetMac) {
        return helmetBoundDao.getMac(helmetMac);
    }

    @Override
    public Helmet getMachineId(Integer machineId) {
        return helmetBoundDao.getMachineId(machineId);
    }

    @Override
    public void delMac(String helmetMac) {
        helmetBoundDao.delMac(helmetMac);
    }

    @Override
    public void delId(Integer machineId) {
        helmetBoundDao.delId(machineId);
    }
}
